<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>LODOP测试</title>
		<script language="javascript" src="js/LodopFuncs.js"></script>
	</head>

	<body>
		<h2><font color="#009999">演示如何打印当前页面的内容：</font></h2>

		<div id="form1">hello world</div>
		<br>

		<a href="javascript:prn1_preview()">打印预览</a>
		<a href="javascript:prn1_print()">直接打印</a>
		<a href="javascript:prn1_printA()">选择打印机</a>

		<script language="javascript" type="text/javascript">
		    var LODOP; //声明为全局变量
			function prn1_preview() {
				CreateOneFormPage();
				LODOP.PREVIEW();
			};
			function prn1_print() {
				CreateOneFormPage();
				LODOP.PRINT();
			};
			function prn1_printA() {
				CreateOneFormPage();
				LODOP.PRINTA();
			};
			function CreateOneFormPage(){
				LODOP = getLodop();
				LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_表单一");
				LODOP.SET_PRINT_STYLE("FontSize",18);
				LODOP.SET_PRINT_STYLE("Bold",1);
				LODOP.ADD_PRINT_TEXT(50,231,260,39,"打印页面部分内容");
				LODOP.ADD_PRINT_HTM(88,200,350,600,document.getElementById("form1").innerHTML);
			};
			// function prn2_preview() {
			// 	CreateTwoFormPage();
			// 	LODOP.PREVIEW();
			// };
			// function prn2_manage() {
			// 	CreateTwoFormPage();
			// 	LODOP.PRINT_SETUP();
			// };
			// function CreateTwoFormPage(){
			// 	LODOP=getLodop();
			// 	LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_表单二");
			// 	LODOP.ADD_PRINT_RECT(70,27,634,242,0,1);
			// 	LODOP.ADD_PRINT_TEXT(29,236,279,38,"页面内容改变布局打印");
			// 	LODOP.SET_PRINT_STYLEA(2,"FontSize",18);
			// 	LODOP.SET_PRINT_STYLEA(2,"Bold",1);
			// 	LODOP.ADD_PRINT_HTM(88,40,321,185,document.getElementById("form1").innerHTML);
			// 	LODOP.ADD_PRINT_HTM(87,355,285,187,document.getElementById("form2").innerHTML);
			// 	LODOP.ADD_PRINT_TEXT(319,58,500,30,"注：其中《表单一》按显示大小，《表单二》在程序控制宽度(285px)内自适应调整");
			// };
			// function prn3_preview(){
			// 	LODOP=getLodop();
			// 	LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_全页");
			// 	LODOP.ADD_PRINT_HTM(0,0,"100%","100%",document.documentElement.innerHTML);
			// 	LODOP.PREVIEW();
			// };
		</script>

</body>
</html>